package com.xzy.learn.spring.ioc.overview.repository;

import com.xzy.learn.spring.entity.User;
import org.springframework.beans.factory.ObjectFactory;

import java.util.Collection;

/**
 * 用户管理
 * @author xzy.xiao
 * @date 2022/5/30  9:26
 */
public class UserRepository {
    private Collection<User> users;
    private ObjectFactory<User> userObjectFactory;

    public Collection<User> getUsers() {
        return users;
    }

    public void setUsers(Collection<User> users) {
        this.users = users;
    }

    public ObjectFactory<User> getUserObjectFactory() {
        return userObjectFactory;
    }

    public void setUserObjectFactory(ObjectFactory<User> userObjectFactory) {
        this.userObjectFactory = userObjectFactory;
    }

    public UserRepository() {
    }

    public UserRepository(Collection<User> users) {
        this.users = users;
    }

    public UserRepository(Collection<User> users, ObjectFactory<User> userObjectFactory) {
        this.users = users;
        this.userObjectFactory = userObjectFactory;
    }

    @Override
    public String toString() {
        return "UserRepository{" +
                "users=" + users +
                ", userObjectFactory=" + userObjectFactory +
                '}';
    }
}
